<?php
class Pageley_Messaging_Mail_Message implements Pageley_Messaging_Message {
    
    private $subject;
    private $content;
    private $contentType;
    private $sender;
    private $recipients;
    
    public function __construct($subject, $content, $contentType = "text/plain", $sender = null,
            $primaryRecipients = null, $secondaryRecipients = null, $anonymousRecipients = null) {
        $this->subject = $subject;
        $this->content = $content;
        $this->contentType = $contentType;
        $this->sender = $sender;
        $this->recipients = new Pageley_Util_ArrayMap();
        $this->recipients->put(Pageley_Messaging_RecipientType::$PRIMARY, $primaryRecipients);
        $this->recipients->put(Pageley_Messaging_RecipientType::$SECONDARY, $secondaryRecipients);
        $this->recipients->put(Pageley_Messaging_RecipientType::$ANONYMOUS, $anonymousRecipients);
    }
    
    public function getContent() {
        return $this->content;
    }
    
    public function getSubject() {
        return $this->subject;
    }
    
    public function getRecipients($type = null) {
        if($type === null) {
            $type = Pageley_Messaging_RecipientType::$PRIMARY;
        }
        return $this->recipients->get($type);
    }
    
    public function getSender() {
        return $this->sender;
    }
    
    public function getContentType() {
        return $this->contentType();
    }
}